import { http } from "@/utils/http";

// 查询灵工项目模板列表-商户端
export function getPageList(params) {
  return http.request("get", "/business/project-template/paged-list", { params });
}

export function getTemplates(merchantsInfoId: number) {
  return http.request("get", `/business/project-template/${merchantsInfoId}/templates`);
}

//代理端
// export function getPageList(params) {
//   return http.request("get", "/business/projectTemplate/listAgent", { params });
// }

//新增/编辑项目模板
export const submitData = (params: any) => {
  return http.request(
    params.id ? "put" : "post",
    `/business/project-template/${params.id ?? ""}`,
    {
      data: params
    }
  );
};

export const getSingle = (id: number) => {
  return http.request("get", `/business/project-template/${id}`);
};
